package com.chixing.controller;

import com.chixing.service.IndexHotelService;
import com.chixing.util.ServerResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;


@Controller
public class IndexHotelController {
    @Autowired
    private IndexHotelService indexHotelService;

    @GetMapping("index")
    public ModelAndView getAll(){
        ServerResponse serverResponse = indexHotelService.getAll();
        ModelAndView mav = new ModelAndView();
        mav.addObject("serverResponse",serverResponse);
        mav.setViewName("index");
        return mav;
    }
}
